<%@ page language="java" pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<%@ taglib prefix="product" tagdir="/WEB-INF/tags/product"%>
<%@ taglib prefix="system" tagdir="/WEB-INF/tags/system"%>
<%@ taglib prefix="sales" tagdir="/WEB-INF/tags/sales"%>

<table border="0" cellspacing="0" cellpadding="0" class="table_cart">
		<colgroup valign="middle">
			<col />
			<col width="100" />
			<col width="100" />
			<col width="150" />
			<col width="150" />
		</colgroup>
		<tr>
				<th class="t_title"><span><fmt:message key="shoppingcartItem.product"/></span></th>
				<th class="t_price"><span><fmt:message key="shoppingcartItem.priceInfo"/></span></th>
				<th class="t_amount"><span><fmt:message key="shoppingcartItem.quantity"/></span></th>
				<th class="t_total"><span><fmt:message key="shoppingcartItem.subtotal"/></span></th>
				<th class="t_do"><span><fmt:message key="shoppingcartItem.operate"/></span></th>
		</tr>
		<c:if test="${empty shoppingcart.shoppingCartItems}">
		<tr><td colspan="5"><fmt:message key="shoppingcart.message.isEmpty"/></td></tr>
		</c:if>
		<!-- 普通商品 -->
		<c:forEach items="${shoppingcart.productItems}" var="item" varStatus="status">
		<tr>
				<td class="t_title">
					<product:productSkuImage productSkuId="${item.productSku.productSkuId}" linkType="1"/><a href="<product:productUrl product="${item.productSku.product}"/>" target="_blank">${item.productSku.product.productName}</a>
					<div class="props">
						<span>${item.productSku.orderSkuDisplayOption}</span>
					</div>
				</td>
				<td class="t_price">
					<span id="priceSpan${item.hashCode}"><common:currencyFormat value="${item.discountPrice}"/></span>
				</td>
				<td class="t_amount">
					<a href="javascript:void(0)" onclick="quantityMinus('${item.productSku.productSkuCode}', ${status.index+1});"><img src="${noTxtImagePath}/icon_minus.gif" width="14" height="14" alt="-" /></a>
					<input type="text" name="quantitys" tabindex="${status.index+1}" style="ime-mode:disabled" onkeypress="javascript:return isNumber(event);" onchange="quantityOnChange('${item.productSku.productSkuCode}', this.value);" class="input_amount" value="${item.quantity}" />
					<input type="hidden" name="productSkuCodes" value="${item.productSku.productSkuCode}" />
					<a href="javascript:void(0)" onclick="quantityPlus('${item.productSku.productSkuCode}', ${status.index+1});"><img src="${noTxtImagePath}/icon_plus.gif" width="14" height="14" alt="+" /></a>
				</td>
				<td class="t_total">
					<span id="totalSpan${item.hashCode}"><common:currencyFormat value="${item.total}"/></span>
					<br/>
					<span id="discountSpan${item.hashCode}">
						<c:if test="${item.itemDiscountAmount>0}">
					    	(<fmt:message key="minicart.money.shen" /><common:currencyFormat value="${item.itemDiscountAmount}"/>) 
						</c:if>
					</span>
				</td>
				<td class="t_do">
					<a href="javascript:void(0)" onclick="javascript:deleteItem('${item.productSku.productSkuCode}', this);"><fmt:message key="shoppingcart.delete"/></a>&nbsp;
					<a href="javascript:void(0)" onclick="javascript:addFavoriteProduct(${item.productSku.product.productId},addFavoriteProductCallback);"><fmt:message key="shoppingcart.addToFavorite"/></a>
				</td>
		</tr>
		</c:forEach>
		<!-- 礼品券 -->
		<c:forEach items="${shoppingcart.giftCertificateItems}" var="item" varStatus="status">
		<tr>
				<td class="t_title">
					<img src="${noTxtImagePath}/coupons_bg1.png" width="50" height="50" alt="Gift" />
					<h4><fmt:message key="shoppingcart.gcName"/></h4>
					<span style="color:#A0A0A4; font-size:11px ">
						<c:if test="${not empty item.shoppingcartItemGc.recipient}">
							<span><fmt:message key="shoppingcart.gcRecipient"/>:${item.shoppingcartItemGc.recipient}</span>
							<br/>
						</c:if>
						<span><fmt:message key="shoppingcart.gcRecipientEmail"/>:${item.shoppingcartItemGc.recipientEmail }</span>
					</span>
				</td>
				<td class="t_price"><common:currencyFormat value="${item.discountPrice}"/></td>
				<td class="t_amount">${item.quantity}</td>
				<td class="t_total"><common:currencyFormat value="${item.total}"/></td>
				<td class="t_do">
					<a href="javascript:void(0)" onclick="javascript:delGiftCertificateItem('${item.shoppingcartItemGc.shoppingcartItemGcId}');"><fmt:message key="shoppingcart.delete"/></a>&nbsp;
				</td>
		</tr>
		</c:forEach>
</table>

